package me.xhy.java.springboot3.r2dbc.s05one2one.s052repository;

import me.xhy.java.springboot3.r2dbc.s05one2one.s051entity.S0513Book;
import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.r2dbc.repository.R2dbcRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;

@Repository
public interface S0522BookRepository extends R2dbcRepository<S0513Book, Long> {

  @Query("select a.*, b.name from t_book a left join t_author b on a.author_id = b.id where b.id = :autheorId")
  Flux<S0513Book> findBookRelAuthor(@Param("authorId")Long authorId);

}
